// pages/novel/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        navFlag: false,
        swiper: [{
            id: '117',
            cover_lateral: 'https://www.9biquge.com/novel/1589.jpg',
            title: '元尊',
            author: '天蚕土豆'
        }, {
            id: '118',
            cover_lateral: "https://www.9biquge.com/novel/41983.jpg",
            title: '终宋',
            author: '怪诞的表哥'

        }, {
            id: '119',
            cover_lateral: 'https://www.9biquge.com/novel/17590.jpg',
            title: '大奉打更人',
            author: '卖报小郎君'

        }, ]

    },


    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {

    },
    onDetail(e) {
        let id = e.currentTarget.dataset.id

        console.log(id);
        wx.navigateTo({
            url: `/pages/novel-detail/index?id=${id}`,
        })

    },
    scroll(e) {
        // console.log(e, 'scroll')
        let scrollTop = e.detail.scrollTop
        if (scrollTop >= 110) {
            this.setData({
                navFlag: true
            })
        } else {
            this.setData({
                navFlag: false
            })
        }
    },
    scrollToTop() {
        this.setData({
            scrollTop: 0
        })
    },
    lower() {

    },

})